import { Entity, PrimaryColumn, Column, CreateDateColumn, UpdateDateColumn } from 'typeorm';

/**
 * 用户实体
 */
@Entity({ name: 'user' })
export class UserEntity {
  @PrimaryColumn({ length: 32 })
  id: string;

  @Column({ length: 20, comment: '用户名' })
  username: string;

  @Column({ length: 128, comment: '密码' })
  password: string;

  @Column({ length: 11, nullable: true, comment: '电话' })
  phone: string;

  @Column({ length: 20, nullable: true, comment: '邮箱' })
  email: string;

  @Column({ type: 'tinyint', default: 1, comment: '性别' })
  gender: number;

  @Column({ type: 'date', nullable: true, comment: '生日' })
  birthday: Date;

  @CreateDateColumn()
  create_at: Date;

  @UpdateDateColumn()
  update_at: Date;
}
